package com.yz.yrpc.util;

import java.lang.reflect.Method;
import java.util.ArrayList;
import java.util.List;

/**
 * @author shanchong
 * @date 2019-07-09
 **/
public class ClassUtil {


    public static List<Method> getMethods(Class clazz){
        final ArrayList<Method> methodList = new ArrayList<>();
        final Method[] methods = clazz.getMethods();
        for (int i = 0; i < methods.length; i++) {
            final Method method = methods[i];
            if (method.getName().startsWith("get")){
                methodList.add(method);
            }
        }
        return methodList;
    }


}
